chore: "no fail fast" test mode#367
Merged
Merged
Conversation
Add a no-fail-fast mode activated by `PDU_NO_FAIL_FAST=true` that continues running all checks instead of stopping at the first failure, then reports a summary at the end. This helps AI environments that may fail on some checks but need to see which ones pass. Update AI instruction templates to document the new flag. https://claude.ai/code/session_01VHRbHsz8VJFdNioSj6dyxe
Add a comment explaining why a temporary file is used instead of a variable for the failure marker, and log the failed command with its exit code when no-fail-fast mode catches a failure. https://claude.ai/code/session_01VHRbHsz8VJFdNioSj6dyxe
…n template Update the source template and regenerate all AI instruction files. https://claude.ai/code/session_01VHRbHsz8VJFdNioSj6dyxe
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an opt-in “no fail fast” mode to the repository test harness so developers can run the full suite of checks and see all failures in one pass, and documents the new option in the AI instruction docs.
Changes:
- Introduces
PDU_NO_FAIL_FASTenv var intest.shto keep running checks after a failure and fail at the end if anything failed. - Tracks failures across subshells via a temporary failure marker file.
- Documents
PDU_NO_FAIL_FAST=truein the shared AI instruction template and the generated instruction docs.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test.sh | Adds env var validation and accumulates failures instead of exiting immediately when enabled. |
| template/ai-instructions/shared.md | Documents the new PDU_NO_FAIL_FAST=true option (source template). |
| CLAUDE.md | Documents the new PDU_NO_FAIL_FAST=true option (generated instructions). |
| AGENTS.md | Documents the new PDU_NO_FAIL_FAST=true option (generated instructions). |
| .github/copilot-instructions.md | Documents the new PDU_NO_FAIL_FAST=true option (generated instructions). |
Performance Regression Reportscommit: e3500a9 --quantity=apparent-size --max-depth=1 --min-ratio=0.01
LogsJSON{
"results": [
{
"command": "pdu",
"mean": 0.10906773951090908,
"stddev": 0.015256948607487041,
"median": 0.10250157092,
"user": 0.09095428181818183,
"system": 0.2809843218181818,
"min": 0.09431295792,
"max": 0.13327028792,
"times": [
0.13327028792,
0.12798016892000003,
0.11930590692,
0.12199808792,
0.12587480692000003,
0.12544955392,
0.12528852492,
0.12551411092,
0.12522446492000003,
0.11792840192000001,
0.10911334192,
0.09516013892,
0.09446259692,
0.09588979992,
0.09487316292,
0.09431295792,
0.09434927492,
0.09447484992,
0.09471591992,
0.09472889392,
0.09445347992,
0.09512153692
],
"exit_codes": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
},
{
"command": "pdu-0.20.0",
"mean": 0.09540807175870969,
"stddev": 0.0005344714088904479,
"median": 0.09534934192,
"user": 0.09206647096774194,
"system": 0.28081568838709675,
"min": 0.09406559592,
"max": 0.09674943592,
"times": [
0.09531312092,
0.09592598792,
0.09589697392,
0.09674943592,
0.09541420192,
0.09559835692,
0.09576501792,
0.09512688992,
0.09537883692,
0.09586499392,
0.09491617392,
0.09557271792,
0.09491572192,
0.09511620692,
0.09476780592,
0.09660609792,
0.09520186692,
0.09528962092,
0.09491986992,
0.09574538092,
0.09487910292,
0.09534934192,
0.09527437192,
0.09497265892,
0.09406559592,
0.09512544392,
0.09614286292,
0.09531963692,
0.09555154892,
0.09537945792,
0.09550492292
],
"exit_codes": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
]
} |
- Use mktemp -d with a marker file inside to avoid path reuse - Quote $failure_marker in the final check for consistency - Use $* instead of $@ in error message for unambiguous logging https://claude.ai/code/session_01VHRbHsz8VJFdNioSj6dyxe
Replace explicit rm -rf calls with a trap to ensure cleanup happens even when errexit terminates the script early in fail-fast mode. https://claude.ai/code/session_01VHRbHsz8VJFdNioSj6dyxe
…mode Use `printf '%q'` with `"$@"` to preserve argument quoting and capture exit status into a variable for reliability. https://claude.ai/code/session_01VHRbHsz8VJFdNioSj6dyxe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a new
PDU_NO_FAIL_FASTenvironment variable that allows the test script to continue running all checks even when one fails, rather than stopping at the first failure. This is useful for seeing the complete status of all checks in a single run.Key Changes
test.sh:
PDU_NO_FAIL_FASTenvironment variable (accepts 'true' or 'false', defaults to 'false')run_if()function to catch command failures whenPDU_NO_FAIL_FAST=trueand record them instead of exiting immediatelyDocumentation files (.github/copilot-instructions.md, AGENTS.md, CLAUDE.md, template/ai-instructions/shared.md):
PDU_NO_FAIL_FAST=trueoption for running all checks and seeing which pass/failImplementation Details
run_ifandunitfunctions) where variable assignments don't propagate to the parent shellPDU_NO_FAIL_FAST=true, failures are logged but don't immediately exit; instead they're recorded and reported at the endPDU_NO_FAIL_FAST=false(default), the script maintains its original fail-fast behaviorhttps://claude.ai/code/session_01VHRbHsz8VJFdNioSj6dyxe